using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class forums_controls_usercp_EditProfile : Controls.DataManagerUserControl
{
    protected override void ItemChanged()
    {
        if (CurrentUser != null)
        {
            mviewProfile.SetActiveView(viewProfile);
            txtEmail.Text = CurrentUser.EmailAddress;
            txtUserTitle.Text = CurrentUser.UserTitle;
            txtSignature.Text = CurrentUser.Signature;
            txtInterests.Text = CurrentUser.Interests;
            txtBio.Text = CurrentUser.Bio;
            txtLocation.Text = CurrentUser.Location;
            txtWebsite.Text = CurrentUser.Website;
            txtOccupation.Text = CurrentUser.Occupation;
            Page.Title = "FSTDT Forums: " + "Edit Profile";
        }
        else
        {
            mviewProfile.SetActiveView(viewError);
            Page.Title = "FSTDT Forums: " + "Oops!";
        }
    }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        CurrentUser.EmailAddress = txtEmail.Text;
        CurrentUser.UserTitle = txtUserTitle.Text;
        CurrentUser.Signature = txtSignature.Text;
        CurrentUser.Interests = txtInterests.Text;
        CurrentUser.Bio = txtBio.Text;
        CurrentUser.Location = txtLocation.Text;
        CurrentUser.Website = txtWebsite.Text;
        CurrentUser.Occupation = txtOccupation.Text;
        DAL.Users.Save(CurrentUser);
        lblMsg.Visible = true;
    }
}
